package com.example.flowable.listener;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class HuiqianEndListener implements ExecutionListener {
    @Override
    public void notify(DelegateExecution delegateExecution) {
        log.info("执行监听器end事件");
        Map<String,Object> map = new HashMap<>();
        map.put("exetype", "Y");
        if ((Integer) delegateExecution.getVariable("reject") > 0) {
            map.put("exetype", "N");
        }
        // System.out.println("HuiqianEndListener");
        delegateExecution.setVariables(map);
    }
}
